<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //if语句
        var flag = true;
        if (flag) {
            console.log("我是真的");
        }
        //if...else语句
        var num1 = 10;
        var num2 = 20;
        if (num1 > num2) {
            console.log("你厉害！");
        } else {
            console.log("你真棒！");
        }

        //switch语句
        var day = 3;
        switch (day) {
            case 0:
                console.log("今天星期一");
                break;
            case 1:
                console.log("今天星期二");
                break;
            case 2:
                console.log("今天星期三");
                break;
            case 3:
                console.log("今天星期四");
                break;
            case 4:
                console.log("今天星期五");
                break;
            default:
                console.log("今天不上班");
        }

        var x=2;
        switch(x){
            case 0:
                console.log("x=1");
            case 1:
                console.log("x=2");
            case 2:
                console.log("x=3");
            case 3:
                console.log("x=4");
            default:
                console.log("未知");
        }
    </script>
</body>

</html>